//
//  MStausBottom.swift
//  iOSweibo
//
//  Created by lzm on 16/5/20.
//  Copyright © 2016年 lzm. All rights reserved.
//

import UIKit
import SnapKit

class MStausBottom: UIView {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
//        backgroundColor = UIColor.greenColor()
        prepareUI()
    }
    
    private func prepareUI()
    {
        //添加子控件
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(zanButton)
        
        //添加约束
        //转发约束
        forwardButton.snp_makeConstraints { (make) -> Void in
            make.top.leading.bottom.equalTo(self)
        }
        //评论约束
        commentButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(forwardButton.snp_trailing)
            make.top.bottom.equalTo(self)
            make.width.equalTo(forwardButton)
        }
        //赞约束
        zanButton.snp_makeConstraints { (make) -> Void in
            make.top.bottom.trailing.equalTo(self)
            make.leading.equalTo(commentButton.snp_trailing)
            make.width.equalTo(forwardButton)
        }
       
        
    }

    //MARK: 懒加载
    private lazy var forwardButton: UIButton = UIButton(BKGimage: "timeline_card_bottom_background", imageName: "timeline_icon_retweet", title: "转发")
    
    private lazy var commentButton: UIButton = UIButton(BKGimage: "timeline_card_bottom_background", imageName: "timeline_icon_comment", title: "评论")
    
    private lazy var zanButton: UIButton = UIButton(BKGimage: "timeline_card_bottom_background", imageName: "timeline_icon_unlike", title: "赞")
}
